<!--
 * @Author:
 * @Date: 2022-11-24 13:56:00
 * @LastEditors:
 * @LastEditTime: 2022-12-04 15:43:20
 * @FilePath: \immoka-admin\src\views\room\rocketRecordDetail.vue
 * @Description:
 *
 * Copyright (c) 2022 by  , All Rights Reserved.
-->
<template>
  <div v-enter-helper="getList" class="app-container">
    <el-card class="box-card">
      <div class="item">
        <el-table
          ref="dataList"
          v-loading="listLoading"
          :data="menuList"
          :default-sort="{prop: 'created_at', order: 'descending'}"
          :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
          border
          row-key="id"
          style="width:100%;margin-bottom: 20px;"
        >
          <el-table-column label="ID" type="index"></el-table-column>
          <!--          <el-table-column label="ID" prop="id" sortable></el-table-column>-->
          <el-table-column label="收礼用户ID" prop="log.target.code"></el-table-column>
          <el-table-column label="用户名称" prop="log.target.nickname"></el-table-column>
          <el-table-column label="礼物名称" prop="log.gift.name"></el-table-column>
          <el-table-column label="礼物价格" prop="log.gift.coin"></el-table-column>
          <el-table-column label="礼物数量" prop="log.count"></el-table-column>
          <el-table-column label="时间" prop="created_at"></el-table-column>
        </el-table>
        <!-- 分页 -->
        <!--        <cus-pagination-->
        <!--          :limit.sync="listQuery.perPage"-->
        <!--          :page.sync="listQuery.page"-->
        <!--          :total="total"-->
        <!--          @pagination="getList"-->
        <!--        />-->
      </div>
    </el-card>
  </div>
</template>

<script>
import { detailListData } from '@/api/room/rocketRecord'

export default {
  data() {
    return {
      confirmBtn: false,
      listLoading: false,
      menuList: [],
      rocketId: ''
    }
  },
  async created() {
    this.rocketId = this.$route.query.id
    await this.getList(this.rocketId)
  },
  methods: {
    getIndex(index) {
      return (this.listQuery.page - 1) * this.listQuery.perPage + index + 1
    },

    async getList(id) {
      const res = await detailListData(id)
      this.menuList = res.data.logs
      this.confirmBtn = false
    }
  }
}
</script>

<style scoped>
[v-cloak] {
  display: none;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both;
}

.box-card {
  width: 100%;
}

.demo-form-inline {
  /* float: right; */
}

/deep/ .el-card__header {
  padding-bottom: 0;
}
</style>
